/**
 * Created by Administrator on 15-4-2.
 */
var express = require('express');
var router = express.Router();
var categoryServices = require('../services/Category');

/** -------------------------------------------------------------------------------------
 *  分类
 *  -------------------------------------------------------------------------------------
 */
router.route('/list')
    .get(function (req, res) {

        var type = req.query.type;
        categoryServices.list(type, function (result) {

            if (result) {
                res.statusCode = 200;
                res.send({category: result});
            } else {
                res.statusCode = 500;
                res.send({category: result});
            }

        })
    })
;

module.exports = router;
